package com.itxuhang.order.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("nacos")
@RefreshScope //只需要在需要动态读取配置的类上添加此注解就可以
public class NacosController {

    @Value("${app.name}")
    private String appName;


    @RequestMapping("refresh")
    public String refresh(){
        return appName;
    }
}
